<div class="panel panel-default panel-intro">

    <div class="panel-heading">
        {:build_heading(null,FALSE)}
        <ul class="nav nav-tabs" data-field="status">
            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
            {foreach name="statusList" item="vo"}
            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
            {/foreach}
        </ul>
    </div>


    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
<!--                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>-->
<!--                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('product/goodsselect/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('product/goodsselect/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
<!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('product/goodsselect/del')?'':'hide'}" title="分配" ><i class="fa fa-plus"></i> 分配</a>-->

                        <a class="btn btn-info btn-disabled disabled btn-selected" href="javascript:;"><i class="fa fa-leaf"></i> 认证分类产品</a>
<!--                        <div class="dropdown btn-group {:$auth->check('product/goodsselect/multi')?'':'hide'}">-->
<!--                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<!--                            <ul class="dropdown-menu text-left" role="menu">-->
<!--                                {foreach name="statusList" item="vo"}-->
<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>-->
<!--                                {/foreach}-->
<!--                            </ul>-->
<!--                        </div>-->

                        <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('product/goodsselect/recyclebin')?'':'hide'}" href="product/goodsselect/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
                    </div>
                    <input type="hidden" value="{$agent_id ?? 0}" id="agent_id">
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           data-operate-edit="{:$auth->check('product/goodsselect/edit')}"
                           data-operate-del="{:$auth->check('product/goodsselect/del')}"
                           width="100%">
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>

<div class="modal fade" id="delModal" tabindex="-1" role="dialog" aria-labelledby="delModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="delModalLabel">操作提示:</h4>
            </div>
            <div class="modal-body">
                <input type="hidden" id="del_ids" name="ids" value="">
                <h5 id="delBody">确定要取消认购产品？</h5>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="deleteIds">确定删除</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>


<script>
  //定义表格操作编辑删除 title="删除"
  function DeleteByIds(id){
    var ids = [];
    ids.push(id);
    //alert(JSON.stringify(ids));
    //把ids的值给到隐藏输入框
    $('#del_ids').val(JSON.stringify(ids));
    //调出删除模态框
    $("#delModal").modal();
  };

  // 作者-上海悠悠 QQ交流群:717225969
  // blog地址 https://www.cnblogs.com/yoyoketang/


  // $("#deleteIds").click(function() {
  //   var del_ids = $('#del_ids').val();
  //   let agent_id=$('#agent_id').val();
  //
  //   $.ajax({
  //     cache: false,
  //     url: "product/Goodsselect/deleteAgentGoods", //url
  //     type: "POSt",  //方法类型
  //     contentType:"application/json",//设置请求参数类型为json字符串
  //     dataType: "json",  //预期服务器返回的数据类型
  //     data: JSON.stringify({agent_id:agent_id,ids: del_ids}),
  //     success: function (result) {
  //       //隐藏模态框
  //       $("#delModal").modal('hide');
  //       if (result.msg == "success"){
  //         // 此处可以显示一个toastr消息
  //         alert('删除成功！')
  //       }
  //       else {
  //         alert("删除失败")
  //       }
  //     },
  //     error: function () {
  //       $("#delModal").modal('hide');
  //       // 此处可以显示一个toastr消息
  //       alert("删除失败,服务器异常")
  //     }
  //   });
  // })
</script>

